package com.matrix.draft.kafka.day1;

import com.matrix.draft.kafka.common.MQTTProducer;

import java.util.concurrent.TimeUnit;

public class MQTTSendMessage {
    public static void main(String[] args) throws InterruptedException {
        MQTTProducer producer = new MQTTProducer();
        for (int i = 0; i < 10; i++) {
            producer.sendMessage(
                    "user-trace",
                    "{x:123.456,y:789.101112}",
                    (meta, e) -> System.out.println(meta.topic()+" 发送成功")
            );
        }

        TimeUnit.SECONDS.sleep(Integer.MAX_VALUE);

    }
}
